<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>Adds a property to a type</title>

 </head>
 <body><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="sdo-das-changesummary.islogging.html">SDO_DAS_ChangeSummary::isLogging</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="sdo-das-datafactory.addtype.html">SDO_DAS_DataFactory::addType</a></div>
 <div class="up"><a href="ref.sdo.html">SDO 函数</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div><hr /><div id="sdo-das-datafactory.addpropertytotype" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">SDO_DAS_DataFactory::addPropertyToType</h1>
  <p class="verinfo">(^)</p><p class="refpurpose"><span class="refname">SDO_DAS_DataFactory::addPropertyToType</span> &mdash; <span class="dc-title">
   Adds a property to a type
  </span></p>

 </div>
 <div class="refsect1 description" id="refsect1-sdo-das-datafactory.addpropertytotype-description">
  <h3 class="title">说明</h3>
  <div class="methodsynopsis dc-description">
   <span class="type"><span class="type void">void</span></span> <span class="methodname"><strong>SDO_DAS_DataFactory::addPropertyToType</strong></span>
    ( <span class="methodparam"><span class="type">string</span> <code class="parameter">$parent_type_namespace_uri</code></span>
   , <span class="methodparam"><span class="type">string</span> <code class="parameter">$parent_type_name</code></span>
   , <span class="methodparam"><span class="type">string</span> <code class="parameter">$property_name</code></span>
   , <span class="methodparam"><span class="type">string</span> <code class="parameter">$type_namespace_uri</code></span>
   , <span class="methodparam"><span class="type">string</span> <code class="parameter">$type_name</code></span>
   [, <span class="methodparam"><span class="type">array</span> <code class="parameter">$options</code></span>
  ] )</div>


  <div class="warning"><strong class="warning">Warning</strong><p class="simpara">此函数是<em class="emphasis">实验性</em>的。此函数的表象，包括名称及其相关文档都可能在未来的
PHP 发布版本中未通知就被修改。使用本函数风险自担 。</p></div>

  <p class="para">
   Adds a property to a type. The type must already be known to the
   SDO_DAS_DataFactory (i.e. have been added using addType()). The property
   becomes a property of the type. This is how the graph model for the
   structure of an SDO_DataObject is built.
  </p>

 </div>

 <div class="refsect1 parameters" id="refsect1-sdo-das-datafactory.addpropertytotype-parameters">
  <h3 class="title">参数</h3>
  <p class="para">
   <dl>

    
     <dt>

      <em><code class="parameter">parent_type_namespace_uri</code></em>
     </dt>

     <dd>

      <p class="para">
       The namespace URI for the parent type.
      </p>
     </dd>

    
    
     <dt>

      <em><code class="parameter">parent_type_name</code></em>
     </dt>

     <dd>

      <p class="para">
       The type name for the parent type.
      </p>
     </dd>

    
    
     <dt>

      <em><code class="parameter">property_name</code></em>
     </dt>

     <dd>

      <p class="para">
       The name by which the property will be known in the parent type.
      </p>
     </dd>

    
    
     <dt>

      <em><code class="parameter">type_namespace_uri</code></em>
     </dt>

     <dd>

      <p class="para">
       The namespace URI for the type of the property.
      </p>
     </dd>

    
    
     <dt>

      <em><code class="parameter">type_name</code></em>
     </dt>

     <dd>

      <p class="para">
       The type name for the type of the property
      </p>
     </dd>

    
    
     <dt>

      <em><code class="parameter">options</code></em>
     </dt>

     <dd>
<p class="para"> This array holds one or more key=&gt;value pairs to set attribute
      values for the property. The optional keywords are:</p>
      <dl>

       
        <dt>
<em><code class="parameter">many</code></em></dt>

        <dd>

         <p class="para">A flag to say whether the property is many-valued. A value of &#039;true&#039; adds the
          property as a many-valued property (default is &#039;false&#039;).
         </p>
        </dd>

       
       
        <dt>

         <em><code class="parameter">readOnly</code></em>
        </dt>

        <dd>

         <p class="para"> A flag to say whether the property is read-only. A value of &#039;true&#039; means the
          property value cannot be modified through the SDO application APIs (default is
          &#039;false&#039;).
         </p>
        </dd>

       
       
        <dt>

         <em><code class="parameter">containment</code></em>
        </dt>

        <dd>

         <p class="para"> A flag to say whether the property is contained by the parent. A value of
          &#039;true&#039; means the property is contained by the parent. A value of &#039;false&#039; results
          in a non-containment reference (default is &#039;true&#039;). This flag is only
          interpreted when adding properties which are data object types, otherwise it is
          ignored.
         </p>
        </dd>

       
       
        <dt>

         <em><code class="parameter">default</code></em>
        </dt>

        <dd>

         <p class="para"> A default value for the property. Omitting this key means that the property
          does not have a default value. A property can only have a default value if it is a
          single-valued data type (primitive).
         </p>
        </dd>

       
      </dl>

     </dd>

    
   </dl>

  </p>
 </div>

 <div class="refsect1 returnvalues" id="refsect1-sdo-das-datafactory.addpropertytotype-returnvalues">
  <h3 class="title">返回值</h3>
  <p class="para">
   None.
  </p>
 </div>


 

 <div class="refsect1 changelog" id="refsect1-sdo-das-datafactory.addpropertytotype-changelog">
  <h3 class="title">更新日志</h3>
  <p class="para">
   <table class="doctable informaltable">
    
     <thead>
      <tr>
       <th>版本</th>
       <th>说明</th>
      </tr>

     </thead>

     <tbody class="tbody">
      <tr>
       <td>0.5.2</td>
       <td>Optional parameters <var class="varname"><var class="varname">many</var></var>, 
        <var class="varname"><var class="varname">readOnly</var></var>, and <var class="varname"><var class="varname">containment</var></var>
        deprecated in favour of the <var class="varname"><var class="varname">options</var></var> array.
        </td>
      </tr>

     </tbody>
    
   </table>

  </p>
 </div>



 <div class="refsect1 examples" id="refsect1-sdo-das-datafactory.addpropertytotype-examples">
  <h3 class="title">范例</h3>
  <p class="para">
   <div class="example" id="example-5346">
    <p><strong>Example #1 A
     <span class="function"><strong>SDO_DAS_DataFactory::addPropertyToType()</strong></span>
     example</strong></p>
    <div class="example-contents"><p> The following adds an &#039;addressline&#039; property to a Person type. The person type is
     identified by its namespace, &#039;PersonNS&#039;, and type name, &#039;PersonType&#039;. The type of the
     &#039;addressline&#039; property is a many-valued SDO data type (primitive) with namespace
     &#039;commonj.sdo&#039; and type name &#039;String&#039;.
    </p></div>
    <div class="example-contents">
     <div class="phpcode"><code><span style="color: #000000">
<span style="color: #0000BB">&lt;?php<br />&nbsp;&nbsp;$df</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">addPropertyToType</span><span style="color: #007700">(</span><span style="color: #DD0000">'PersonNS'</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">'PersonType'</span><span style="color: #007700">,<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #DD0000">'addressline'</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">'commonj.sdo'</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">'String'</span><span style="color: #007700">,&nbsp;array(</span><span style="color: #DD0000">'many'</span><span style="color: #007700">=&gt;</span><span style="color: #0000BB">true</span><span style="color: #007700">));<br /></span><span style="color: #0000BB">?&gt;</span>
</span>
</code></div>
    </div>

   </div>
  </p>
 </div>

 
 


</div><hr /><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="sdo-das-changesummary.islogging.html">SDO_DAS_ChangeSummary::isLogging</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="sdo-das-datafactory.addtype.html">SDO_DAS_DataFactory::addType</a></div>
 <div class="up"><a href="ref.sdo.html">SDO 函数</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div></body></html>
